package cn.dkk.behavior_design.observer;

/**
 * @author dkk
 * @date 2022/7/26
 * @desc
 */
public class FirstObserver implements Observer{

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public FirstObserver(String name) {
        this.name = name;
    }

    /**
     * 监听消息
     * @param mes 消息
     */
    @Override
    public void update(String mes) {
        System.out.println(name+"接收到了消息:"+mes);
    }
}
